package cn.java76.springboot.demo1.controller;

import cn.java76.springboot.demo1.config.Paper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author oldliu
 * @since 1.0
 */
@RestController
public class BeanController {

    @Autowired
    @Qualifier("a4")
    private Paper paper;

    @Resource(name = "b5")
    private Paper p2;

    @GetMapping("finda4")
    public Paper find1(){
        return paper;
    }
    @GetMapping("findb5")
    public Paper find3(){
        return p2;
    }
}
